import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/warehousing_entity.dart';

WarehousingEntity $WarehousingEntityFromJson(Map<String, dynamic> json) {
  final WarehousingEntity warehousingEntity = WarehousingEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    warehousingEntity.companyCode = companyCode;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    warehousingEntity.createDate = createDate;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    warehousingEntity.id = id;
  }
  final int? outboundOrInbound = jsonConvert.convert<int>(json['outboundOrInbound']);
  if (outboundOrInbound != null) {
    warehousingEntity.outboundOrInbound = outboundOrInbound;
  }
  final int? receiptQuantity = jsonConvert.convert<int>(json['receiptQuantity']);
  if (receiptQuantity != null) {
    warehousingEntity.receiptQuantity = receiptQuantity;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    warehousingEntity.updateDate = updateDate;
  }
  return warehousingEntity;
}

Map<String, dynamic> $WarehousingEntityToJson(WarehousingEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createDate'] = entity.createDate;
  data['id'] = entity.id;
  data['outboundOrInbound'] = entity.outboundOrInbound;
  data['receiptQuantity'] = entity.receiptQuantity;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension WarehousingEntityExtension on WarehousingEntity {
  WarehousingEntity copyWith({
    String? companyCode,
    String? createDate,
    String? id,
    int? outboundOrInbound,
    int? receiptQuantity,
    String? updateDate,
  }) {
    return WarehousingEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..outboundOrInbound = outboundOrInbound ?? this.outboundOrInbound
      ..receiptQuantity = receiptQuantity ?? this.receiptQuantity
      ..updateDate = updateDate ?? this.updateDate;
  }
}
